package com.originskyseed.platform.user.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.user.model.TradeUnion;

/**
 * 公会信息Mapper类（OSI_TRADE_UNION）
 *
 * @author tangwanghui
 */
public interface TradeUnionMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(TradeUnion record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(TradeUnion record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(TradeUnion record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(TradeUnion record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByUserId(TradeUnion record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public TradeUnion selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<TradeUnion> selectList(TradeUnion record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<TradeUnion> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 开放平台选择公会 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<TradeUnion> selectTradeUnionList(Map<String, Object> params) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public TradeUnion selectByUserId(@Param("userId") String userId) throws Exception;

	/**
	 * 查询公会id是否存在
	 *
	 * @param tradeUnionIds
	 * @return
	 * @throws Exception
	 */
	public List<String> selectTradeUnionIds(List<String> tradeUnionIds) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param list
	 * @return
	 * @throws Exception
	 */
	public int insertBatch(List<TradeUnion> list) throws Exception;
}
